#include "pch.hpp"

void directToVector(sf::Sprite &sprite, sf::Vector2f vector, bool rotate)
{
	sf::Vector2f up(0,-1);
	sfm::Normalize(up);
	sfm::Normalize(vector);

	float angle = sfm::AngleBetweenD(up,vector);
	if(vector.x > 0)
		angle = 360 - angle;

	if (rotate)
		sprite.SetRotation(angle);
}